package com.chenxi.vhr.controller;

import com.chenxi.vhr.bean.BaseUser;
import com.chenxi.vhr.bean.common.Result;
import com.chenxi.vhr.service.BaseUserService;
import com.chenxi.vhr.utils.SystemUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author : zhangchenxi
 * @create : 2022-02-16
 **/
@RestController
@RequestMapping("/chat")
public class ChatController {

    @Autowired
    BaseUserService baseUserService;

    @GetMapping("/getUserList")
    public Result list() {
        BaseUser baseUser = SystemUtil.getCurrentUser();
        List<BaseUser> userList = baseUserService.getUserListWithOutCurrentUser(baseUser.getId());
        return Result.ok("用户列表加载成功", userList);
    }
}
